﻿using System;
using System.Collections.Generic;
using Viettel.VOFFICE.DAO.Models;

namespace Viettel.VOFFICE.Web.Models
{
    public class RoleModel : BaseModel
    {
        public string RoleId { get; set; }
        public string RoleName { get; set; }
        public string RoleDisplayName { get; set; }
        public string Description { get; set; }
        public int? Type { get; set; }
        public bool? IsActive { get; set; }
        public DateTime? CreatedAt { get; set; }
        public DateTime? UpdatedAt { get; set; }
        public Guid? CreatorId { get; set; }

        public RoleModel(aspnet_Roles role)
        {
            RoleId = role.RoleId.ToString();
            RoleName = role.RoleName;
            RoleDisplayName = role.RoleDisplayName;
            Description = role.Description;
            IsActive = role.IsActive;
            CreatedAt = role.CreatedAt;
            UpdatedAt = role.UpdatedAt;
            CreatorId = role.CreatorId;
            Type = role.Type;
        }

        public RoleModel()
        {
        }
    }

    public class RoleTree : BaseModel
    {
        public string id { get; set; }
        public string data { get; set; }
        public List<RoleTree> children;
        public RoleTreeAttribute attr { get; set; }
    }

    public class RoleTreeAttribute
    {
        public string id;
        public bool selected;
    }
}